🎖️GitЯра🎖️
Node / meshtastic / Meshtastic-Android / files / core / service / src / androidMain / kotlin / org / meshtastic / core / service / ReactionReceiver.kt
Displaying Raw • Download
core/service/src/androidMain/kotlin/org/meshtastic/core/service/ReactionReceiver.kt fix/qr-error-correction (7b45f84f) Text, 3.12 KB
T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.core.service
Tff7b72import T7ee787android.content.BroadcastReceiver
Tff7b72import T7ee787android.content.Context
Tff7b72import T7ee787android.content.Intent
Tff7b72import T7ee787co.touchlab.kermit.Logger
Tff7b72import T7ee787kotlinx.coroutines.CoroutineScope
Tff7b72import T7ee787kotlinx.coroutines.SupervisorJob
Tff7b72import T7ee787kotlinx.coroutines.launch
Tff7b72import T7ee787org.koin.core.component.KoinComponent
Tff7b72import T7ee787org.koin.core.component.inject
Tff7b72import T7ee787org.meshtastic.core.di.CoroutineDispatchers
Tff7b72import T7ee787org.meshtastic.core.repository.RadioController
Tff7b72import T7ee787kotlin.coroutines.cancellation.CancellationException
T8b949e/**
* Handles inline emoji reaction actions from message notifications.
*
* Uses [goAsync] to keep the process alive while the coroutine dispatches the reaction through [RadioController],
* matching the pattern used by [ReplyReceiver] and [MarkAsReadReceiver].
*/
Tff7b72class T56d364ReactionReceiver Tb4b4b4:
Te6edf3BroadcastReceiverTb4b4b4(Tb4b4b4)Tb4b4b4,
Te6edf3KoinComponent Tb4b4b4{
Tff7b72private Tff7b72val Te6edf3radioControllerTb4b4b4: Te6edf3RadioController Tff7b72by Te6edf3injectTb4b4b4(Tb4b4b4)
Tff7b72private Tff7b72val Te6edf3dispatchersTb4b4b4: Te6edf3CoroutineDispatchers Tff7b72by Te6edf3injectTb4b4b4(Tb4b4b4)
Tff7b72private Tff7b72val Te6edf3scope Tff7b72by Te6edf3lazy Tb4b4b4{ Te6edf3CoroutineScopeTb4b4b4(Te6edf3SupervisorJobTb4b4b4(Tb4b4b4) Tff7b72+ Te6edf3dispatchersTb4b4b4.Te6edf3ioTb4b4b4) Tb4b4b4}
Tf0883e@SuppressTb4b4b4(Ta5d6ff"Ta5d6ffTooGenericExceptionCaughtTa5d6ff"Tb4b4b4, Ta5d6ff"Ta5d6ffReturnCountTa5d6ff"Tb4b4b4)
Tff7b72override Tff7b72fun Td2a8ffonReceiveTb4b4b4(Te6edf3contextTb4b4b4: Te6edf3ContextTb4b4b4, Te6edf3intentTb4b4b4: Te6edf3IntentTb4b4b4) Tb4b4b4{
Tff7b72if Tb4b4b4(Te6edf3intentTb4b4b4.Te6edf3action Tff7b72!Tff7b72= Te6edf3REACT_ACTIONTb4b4b4) Tff7b72return
Tff7b72val Te6edf3contactKey Tff7b72= Te6edf3intentTb4b4b4.Te6edf3getStringExtraTb4b4b4(Te6edf3EXTRA_CONTACT_KEYTb4b4b4) Tff7b72?: Tff7b72return
Tff7b72val Te6edf3reaction Tff7b72= Te6edf3intentTb4b4b4.Te6edf3getStringExtraTb4b4b4(Te6edf3EXTRA_EMOJITb4b4b4) Tff7b72?: Te6edf3intentTb4b4b4.Te6edf3getStringExtraTb4b4b4(Te6edf3EXTRA_REACTIONTb4b4b4) Tff7b72?: Tff7b72return
Tff7b72val Te6edf3replyId Tff7b72= Te6edf3intentTb4b4b4.Te6edf3getIntExtraTb4b4b4(Te6edf3EXTRA_REPLY_IDTb4b4b4, Te6edf3intentTb4b4b4.Te6edf3getIntExtraTb4b4b4(Te6edf3EXTRA_PACKET_IDTb4b4b4, T79c0ff0Tb4b4b4)Tb4b4b4)
Tff7b72val Te6edf3pendingResult Tff7b72= Te6edf3goAsyncTb4b4b4(Tb4b4b4)
Te6edf3scopeTb4b4b4.Te6edf3launch Tb4b4b4{
Tff7b72try Tb4b4b4{
Te6edf3radioControllerTb4b4b4.Te6edf3sendReactionTb4b4b4(Te6edf3reactionTb4b4b4, Te6edf3replyIdTb4b4b4, Te6edf3contactKeyTb4b4b4)
Tb4b4b4} Tff7b72catch Tb4b4b4(Te6edf3eTb4b4b4: Te6edf3CancellationExceptionTb4b4b4) Tb4b4b4{
Tff7b72throw Te6edf3e
Tb4b4b4} Tff7b72catch Tb4b4b4(Te6edf3eTb4b4b4: Te6edf3ExceptionTb4b4b4) Tb4b4b4{
Te6edf3LoggerTb4b4b4.Te6edf3eTb4b4b4(Te6edf3eTb4b4b4) Tb4b4b4{ Ta5d6ff"Ta5d6ffError sending reactionTa5d6ff" Tb4b4b4}
Tb4b4b4} Tff7b72finally Tb4b4b4{
Te6edf3pendingResultTb4b4b4.Te6edf3finishTb4b4b4(Tb4b4b4)
Tb4b4b4}
Tb4b4b4}
Tb4b4b4}
Tff7b72companion Tff7b72object Tb4b4b4{
Tff7b72const Tff7b72val Te6edf3REACT_ACTION Tff7b72= Ta5d6ff"Ta5d6fforg.meshtastic.app.REACT_ACTIONTa5d6ff"
Tff7b72const Tff7b72val Te6edf3EXTRA_CONTACT_KEY Tff7b72= Ta5d6ff"Ta5d6ffextra_contact_keyTa5d6ff"
Tff7b72const Tff7b72val Te6edf3EXTRA_REACTION Tff7b72= Ta5d6ff"Ta5d6ffextra_reactionTa5d6ff"
Tff7b72const Tff7b72val Te6edf3EXTRA_REPLY_ID Tff7b72= Ta5d6ff"Ta5d6ffextra_reply_idTa5d6ff"
Tff7b72const Tff7b72val Te6edf3EXTRA_PACKET_ID Tff7b72= Ta5d6ff"Ta5d6ffextra_packet_idTa5d6ff"
Tff7b72const Tff7b72val Te6edf3EXTRA_TO_ID Tff7b72= Ta5d6ff"Ta5d6ffextra_to_idTa5d6ff"
Tff7b72const Tff7b72val Te6edf3EXTRA_CHANNEL_INDEX Tff7b72= Ta5d6ff"Ta5d6ffextra_channel_indexTa5d6ff"
Tff7b72const Tff7b72val Te6edf3EXTRA_EMOJI Tff7b72= Ta5d6ff"Ta5d6ffextra_emojiTa5d6ff"
Tb4b4b4}
Tb4b4b4}
Served by rngit 1.5.0 - Generated in 0.05s